#pragma once
#include "EXProgressCtrlResSet.h"

// CEXProgressCtrl

class AFX_EXT_CLASS CEXProgressCtrl : public CProgressCtrl
{
	DECLARE_DYNAMIC(CEXProgressCtrl)

public:
  enum PROGRESS_STYLE
  {
    NOIMAGE,
    PROGRESS_CTRL = 17,
  };

	CEXProgressCtrl();
	virtual ~CEXProgressCtrl();

	BOOL SetBitmap(UINT nID, int nPics);
	BOOL SetBkgndBitmap(UINT nBkgndID, int nOffsetX = 0 , int nOffsetY = 0, 
                      int nLeftWidth = 0, int nRightWidth = 0, 
                      int nTopHeight = 0, int nBottomHeight = 0);

	int SetPos(int nPos);
	int StepIt();

  void SetResSet(CEXBaseResSet* pResSet);
  CEXProgressCtrlResSet* m_pProgressResSet;

protected:
	BOOL InitBgBitmap(CBitmap &bmpSrc, CBitmap &bmpDest, int nIndex, int nCount);

	UINT m_nBitmapID;
	int m_nPic;
	BOOL m_bSetBitmap;

	CBitmap m_bmpNormal;
	CBitmap m_bmpSelect;
	CBitmap m_bmpFocus;
	CBitmap m_bmpDisable;

	CBrush m_brProgress;
	CBrush m_brNonProgress;

	int m_nBkgndLeftWidth;
	int m_nBkgndRightWidth;
	int m_nBkgndTopHeight;
	int m_nBkgndBottomHeight;
	int m_nBkgndOffsetX;
	int m_nBkgndOffsetY;

	BOOL m_bSetBkgndBitmap;
	UINT m_nBkgndBitmapID;
	CBitmap m_bmpBkgnd;

protected:
	DECLARE_MESSAGE_MAP()
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
public:
	afx_msg void OnSize(UINT nType, int cx, int cy);
};


